package com.funtl.oauth2.controller;

import com.funtl.oauth2.config.Response;
import com.funtl.oauth2.entity.TbContent;
import com.funtl.oauth2.service.TbContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: wumz
 * @Date: 2020/8/8 23:09
 * @Version 1.0
 */
@RestController
public class TbContentController {

    @Autowired
    private TbContentService tbContentService;

    @GetMapping("/list")
    public Response<List<TbContent>> getContentList(){
        List<TbContent> tbContentList = tbContentService.getTbContentList();
        return new Response<>(HttpStatus.OK.value(), HttpStatus.OK.toString(), tbContentList);
    }
}
